/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: jzj
 * Date: 2024-03-23
 * Time: 23:41
 */
public class tset {
     public static int tribonacci(int n) {
         int[] dp = new int[n+1];
         //2.初始化
         if(n==0){
             return 0;
         }
         dp[0] = 0;
         if(n==1 || n==2){
             return 1;
         }
         dp[1] = 1;
         dp[2] = 1;
         //3.填表
         for (int i = 3; i < dp.length; i++) {
             dp[i]=dp[i-1]+dp[i-2]+dp[i-3];
         }
         return dp[n];
    }
    public static void main(String[] args) {
        int n =1;
        int m= tribonacci(n);
    }
}
